﻿using MDT.LifeSewagePlatform.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System.Threading;
using System.Threading.Tasks;

namespace MDT.LifeSewagePlatform.Mysql
{
    public interface IMysqlDBBase
    {
        public DbSet<TEntity> Set<TEntity>() where TEntity : class;
        public Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
        public int SaveChanges();
        public DbSet<RoleEntity> Roles { get; set; }
        public DbSet<UserEntity> Users { get; set; }
        public DbSet<DetailEntity> Details { get; set; }
        public DbSet<FileEntity> Files { get; set; }
        public DbSet<PlaceDutyEntity> PlaceDutys { get; set; }
        public DbSet<DrugEntity> Drug { get; set; }
        public DbSet<DrugDetailEntity> DrugDetail { get; set; }
        public DbSet<AlaramEntity> Alarm { get; set; }
        public DbSet<SetAlarmEntity> SetAlarm { get; set; }
        public DbSet<AlaramPlaceEntity> AlaramPlace { get; set; }
        public DbSet<CompanyEntity> Company { get; set; }
        public DatabaseFacade Database { get; }
        public DbSet<DrugDayEntity> DrugDays { get; set; }
        public DbSet<RegionEntity> Regions { get; set; }
        public DbSet<IpAddressEntity> IpAddress { get; set; }

        public DbSet<AlaramRuleEntity> AlaramRules { get; set; }
        public DbSet<RuleCompanyEntity> RuleCompany { get; set; }

        public ChangeTracker GetChangeTracker();
    }
}
